From 9120af020459233bd56950e72063d2a0f593ae17 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Thu, 15 Dec 2016 02:24:26 +0100 Subject: [PATCH] sse2-int8: permit converting premultiplied gamma RGBA --- extensions/sse2-int8.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/extensions/sse2-int8.c b/extensions/sse2-int8.c index 67ff579..5353de6 100644 --- a/extensions/sse2-int8.c +++ b/extensions/sse2-int8.c @@ -146,6 +146,12 @@ conv_rgbaF_rgba8 (const float *src, uint8_t *dst, long samples) return conv_yF_y8 (src, dst, samples * 4) / 4; } +static long +conv_rgbAF_rgbA8 (const float *src, uint8_t *dst, long samples) +{ + return conv_yF_y8 (src, dst, samples * 4) / 4; +} + #endif int init (void); @@ -154,6 +160,40 @@ int init (void) { #if defined(USE_SSE2) + + const Babl *rgbAF_linear = babl_format_new ( + babl_model ("RaGaBaA"), + babl_type ("float"), + babl_component ("Ra"), + babl_component ("Ga"), + babl_component ("Ba"), + babl_component ("A"), + NULL); + const Babl *rgbA8_linear = babl_format_new ( + babl_model ("RaGaBaA"), + babl_type ("u8"), + babl_component ("Ra"), + babl_component ("Ga"), + babl_component ("Ba"), + babl_component ("A"), + NULL); + const Babl *rgbAF_gamma = babl_format_new ( + babl_model ("R'aG'aB'aA"), + babl_type ("float"), + babl_component ("R'a"), + babl_component ("G'a"), + babl_component ("B'a"), + babl_component ("A"), + NULL); + const Babl *rgbA8_gamma = babl_format_new ( + babl_model ("R'aG'aB'aA"), + babl_type ("u8"), + babl_component ("R'a"), + babl_component ("G'a"), + babl_component ("B'a"), + babl_component ("A"), + NULL); + const Babl *rgbaF_linear = babl_format_new ( babl_model ("RGBA"), babl_type ("float"), @@ -268,6 +308,7 @@ init (void) if ((babl_cpu_accel_get_support () & BABL_CPU_ACCEL_X86_SSE2)) { CONV(rgbaF, rgba8); + CONV(rgbAF, rgbA8); CONV(rgbF, rgb8); CONV(yaF, ya8); CONV(yF, y8); -- 2.30.2